<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition template="/META-INF/templates/customerTemplate.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:mc="http://java.sun.com/jsf/composite/mygourmet">
    <ui:param name="title" value="#{msgs.title_main} - #{msgs.title_edit_dish}"/>
    <ui:define name="content">
        <h2><h:outputText value="#{msgs.title_order_dishes}: #{msgs.select_dishes}"/></h2>
        <h:messages showDetail="true" showSummary="false"/>
        <h:form id="form">
            <mc:dataTable value="#{orderBean.dishes}" var="dish">
                <h:column>
                    <h:selectBooleanCheckbox value="#{dish.selected}"/>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msgs.dish}"/>
                    </f:facet>
                    <h:outputText value="#{dish.dish.name}"/>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msgs.amount}"/>
                    </f:facet>
                    <h:inputText value="#{dish.amount}">
                        <f:validateLongRange minimum="1"/>
                    </h:inputText>
                </h:column>
            </mc:dataTable>
            <h:commandButton id="next" action="#{orderBean.gotoFinish}" value="#{msgs.next}"/>
            <h:commandButton id="finish" action="#{orderBean.finish}" value="#{msgs.finish}" disabled="true"/>
            <h:commandButton id="cancel" action="#{orderBean.cancel}" value="#{msgs.cancel}"
                             immediate="true"/>
        </h:form>
    </ui:define>
</ui:composition>
